<%@ page language="java" import="java.util.*,org.cx.oa.entity.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
	List<ConnectionType> ctList = (List<ConnectionType>)request.getAttribute("ctList");
%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>个人通讯录</title>

  </head>
  
  <body>
    <div>
    <div style="width:100%; height:5%;">
    <s:form><s:submit action="pc_addJsp" value="添加"></s:submit></s:form>
    <s:form><s:submit action="cf_operationJsp" value="设置个人通讯录"></s:submit></s:form>
    </div>
	<div style="width:20%; height:100%; float:left;">
	<s:form>
    <table border="1">
    	<th>关系类型</th>
        <tr>
          <td align="center" >所有关系</td>
        </tr>
        <s:iterator value="ctList" id="ct">
        	<tr>
        		<td align="center" style="widht:30px;height: 20px;">
        		<s:form action="pc_select">
        			<s:hidden name="Id" value="%{#ct.Id}"></s:hidden>
        			<s:submit value="%{#ct.type}"></s:submit>
        		</s:form>
        		</td>
        	</tr>
        </s:iterator>
    </table>
    </s:form>
    </div>
    <div style="width:80%; height:100%">
    <table border="1">
    	<th></th>
        <tr>
        <td>序号</td>
        <td>姓名</td>
        <td>性别</td>
        <td>电话</td>
        <td>手机</td>
        <td>E-Mail</td>
        <td>所在的公司</td>
        <td>操作</td>
        </tr>
        
        	<s:iterator value="pcList" id="pc">
        	<tr>
        		<td style="width:80px;height: 20px;" id="td1">
        			<s:property value="#pc.Id" />
        		</td>
        		<td align="center" style="width:140px;height: 20px;"><s:property value="#pc.CommunicationName"/></td>
        		<td align="center" style="width:140px;height: 20px;">
        		<s:set name="sex" value="#pc.Sex"></s:set>
        		<s:if test="#sex==true">男</s:if>
        		<s:else>女</s:else>
        		</td>
        		<td align="center" style="width:140px;height: 20px;"><s:property value="#pc.FamilyPhone"/></td>
        		<td align="center" style="width:140px;height: 20px;"><s:property value="#pc.MobileNumber"/></td>
        		<td align="center" style="width:140px;height: 20px;"><s:property value="#pc.Emailt"/></td>
        		<td align="center" style="width:140px;height: 20px;"><s:property value="#pc.unitName"/></td>
        		<td>
        		<s:form action="pc_delete">
        		<s:hidden name="Id" value="%{#pc.Id}"></s:hidden>
        		<s:submit value="删除"></s:submit>
        		</s:form>
        		<s:form action="pc_updateJsp">
        			<s:hidden name="Id" value="%{#pc.Id}"></s:hidden>
        			<s:submit value="修改"></s:submit>
        		</s:form>
        		</td>
        		</tr>
        	</s:iterator>
    </table>
    </div>
</div>
  </body>
</html>
